<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@include file="/WEB-INF/page/share/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/shop/css/vip.css" type="text/css">
<title>超市列表</title>
<script language="JavaScript">

	//到指定的分页页面
	function topage(page){
		var form = document.forms[0];
		form.page.value=page;
		form.submit();
	}
	
	function allSelect(){
		var form = document.forms[0];
		var state = form.allselectbox.checked;
		var length = form.marketids.length;
		if(length){
			for(var i=0;i<length;i++){
				form.marketids[i].checked=state;
			}
		}else{
			form.marketids.checked=state;
		}
	}
	function _action(methodName){
		if(selectItem()){
			var form = document.forms[0];
			form.action='<html:rewrite action="/market/manage"/>?method='+ methodName;
			form.submit();
		}else{
			alert("请选择要操作的记录");
		}
	}
	function selectItem(){
		var form = document.forms[0];
		var length = form.marketids.length;
		if(length){
			for(var i=0;i<length;i++){
				if(form.marketids[i].checked) return true;
			}
		}else{
			return form.marketids.checked;
		}
		return false;
	}

</script>
</head>
<body>
<html:form action="/control/market/list" method="post">
	<html:hidden property="page"/>
	<html:hidden property="query"/>
	<table width="98%" border="0" cellspacing="1" cellpadding="2" align="center">
	<tr ><td colspan="12" bgcolor="6f8ac4" align="right">
    	<%@ include file="/WEB-INF/page/share/fenye.jsp" %>
   </td></tr>
		<tr>
			<td bgcolor="6f8ac4"><div align="center">编号</div></td>
			<td bgcolor="6f8ac4"><div align="center">图标</div></td>
			<td bgcolor="6f8ac4"><div align="center">名称</div></td>
			<td bgcolor="6f8ac4"><div align="center">登录帐号</div></td>
			<td bgcolor="6f8ac4"><div align="center">联系地址</div></td>
			<td bgcolor="6f8ac4"><div align="center">所属地区</div></td>
			<td bgcolor="6f8ac4"><div align="center">电话</div></td>
			<td bgcolor="6f8ac4"><div align="center">加入时间</div></td>
			<td bgcolor="6f8ac4"><div align="center">email</div></td>
			<td bgcolor="6f8ac4"><div align="center">传真</div></td>
			<td bgcolor="6f8ac4"><div align="center">排名</div></td>
			<td bgcolor="6f8ac4"><div align="center">状态</div></td>
		</tr>
	<c:forEach items="${pageView.records}" var="market">
		<tr>
			<td><div align="center"><input type="checkbox" name="marketids" value="${market.id }">${market.id }</div></td>
			<td><div align="center"><img src="/shop${market.image140FullPath }" alt="${market.name }" width="40px" height="40px"/></div></td>
			<td><div align="center">${market.name }</div></td>
			<td><div align="center">${market.username }</div></td>
			<td><div align="center">${market.address }</div></td>
			<td><div align="center">${market.belongToaddress.name }</div></td>
			<td><div align="center">${market.phone }</div></td>
			<td><div align="center">${market.regtime }</div></td>
			<td><div align="center">${market.email }</div></td>
			<td><div align="center">${market.foxmail }</div></td>
			<td><div align="center">${market.ranking }</div></td>
			<td><div align="center"><c:if test="${market.loginable }">启用</c:if><c:if test="${!market.loginable }">禁用</c:if></div></td>
		</tr>
	</c:forEach>
		<tr>
			<td><div align="center"><input type="checkbox" name="allselectbox" value="全选" onclick="javascript:allSelect()">全选</div></td>
			<td><input type="button" value="禁用" class="frm_btn" onclick="javascript:_action('delete')"/></td>
			<td><input type="button" value="启用" class="frm_btn" onclick="javascript:_action('enable')"/></td>
			<td><a href="<html:rewrite action='/market/manage'/>?method=regUI">新建商场用户</a></td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
			<td>&nbsp;&nbsp;</td>
		</tr>
	</table>
	</html:form>
</body>
</html>